import request from "@/utils/requestPro.js";


/**
 商家端查询可以报名的商品 */
export function getActivityListAPi(activityCategory) {
	return request({
		url: `/admin/appHome/activityIntroduction/queryActivityIntroduction/${activityCategory}`,
		method: 'get'
		// params,
	});
}

/**
 商家端查询未报名活动详情 */
export function getActivityDelAPi(id) {
	return request({
		url: `/admin/appHome/activityIntroduction/queryActivityDetail/${id}`,
		method: 'get'
		// params,
	});
}

/**
 商家端查询可以报名的商品 */
export function getProActivityAPi(params) {
	return request({
		url: `/admin/appHome/activityIntroduction/queryActivityProduct`,
		method: 'get',
		params
	});
}

/**
 添加活动商品，进行报名 */
export function addEnrolledProAPi(id, data) {
	return request({
		url: `/admin/appHome/activityIntroduction/addEnrolledActivityProduct/${id}`,
		method: 'post',
		id,
		data
	});
}

/**
 商家端查询已报名活动详情 */
export function getRegistrationAPi(id) {
	return request({
		url: `/admin/appHome/activityIntroduction/queryActivityRegistration/${id}`,
		method: 'get',
		// id
	});
}

/**
 商家端删除已报名商品 */
export function deleteEnrolledProAPi(enrolledActivityId) {
	return request({
		url: `/admin/appHome/activityIntroduction/deleteEnrolledActivityProduct/${enrolledActivityId}`,
		method: 'delete',
		// enrolledActivityId
	});
}

/**
 商家端查询已报名商品详情 */
export function getEnrolledProAPi(params) {
	return request({
		url: `/admin/appHome/activityIntroduction/queryEnrolledActivityProductDetail`,
		method: 'get',
		params
	});
}

/**
 商家端修改已报名商品 */
export function updateEnrolledProAPi(data) {
	return request({
		url: `/admin/appHome/activityIntroduction/updateEnrolledActivityProduct`,
		method: 'put',
		data
	});
}

/**
 秒杀活动分页列表 */
export function getSeckillListAPi(params) {
	return request({
		url: `/admin/merchant/seckill/activity/page`,
		method: 'get',
		params
	});
}


// ----------------------降价促销--------------------------------------

// 商家端查询无需审核活动商品
export const getActivityProductApi = (params) => {
	return request({
		url: `/admin/appHome/activityRegistration/queryActivityRegistrationProduct`,
		method: 'get',
		params
	})
}

// 商家端店铺满赠选择商品
export const getFullGiftProductApi = (params) => {
	return request({
		url: `/admin/appHome/activityRegistration/queryActivityRegistrationGift`,
		method: 'get',
		params
	})
}


// 商户端添加/修改无需审核活动
export const addActivityRegistrationApi = (data) => {
	return request({
		url: `/admin/appHome/activityRegistration/addActivityRegistration`,
		method: 'post',
		data
	})
}


// 商户端查询无需报名活动
export const getNoRegistrationActivityApi = (activityCategory) => {
	return request({
		url: `/admin/appHome/activityRegistration/queryActivityNoRegistrationRequired/${activityCategory}`,
		method: 'get',
	})
}
// ---------------------------end--------------------------------
// -----------------------------店铺满赠----------------------
// 获取城市tree结构的列表
export const getCityTreeListApi = () => {
	return request({
		url: '/admin/merchant/city/region/city/tree',
		method: 'get'
	})
}
// 获取品类树形结构的列表
export const getCategoryTreeListApi = () => {
	return request({
		url: '/admin/appHome/activityRegistration/cache/tree',
		method: 'get'
	})
}
// ---------------------------end--------------------------------
/** 商品搜索分页列表(活动)--秒杀 */
export function getSeckillProApi(params) {
	return request({
		url: `/admin/merchant/product/activity/search/page`,
		method: 'GET',
		params
	})
}


/** 秒杀商品添加--秒杀 */
export function addSeckillProApi(data) {
	return request({
		url: `/admin/merchant/seckill/product/add`,
		method: 'POST',
		data
	})
}


/** 秒杀活动详情 */
export function getSeckillInfoApi(id) {
	return request({
		url: `/admin/merchant/seckill/activity/detail/${id}`,
		method: 'GET',
	})
}

/** 秒杀商品sku撤回审核 */
export function withdrawSeckillApi(data) {
	return request({
		url: `/admin/merchant/seckill/product/sku/withdraw`,
		method: 'POST',
		data
	})
}

/** 查询--秒杀商品库存 */
export function stockQuerySeckillApi(skuId) {
	return request({
		url: `/admin/merchant/seckill/stock/query/${skuId}`,
		method: 'GET',
	})
}

/** 设置--秒杀商品库存 */
export function addStockQueryApi(data) {
	return request({
		url: `/admin/merchant/seckill/stock/add`,
		method: 'POST',
		data
	})
}

/** 秒杀商品sku上架 */
export function upSkuProSeckillApi(data) {
	return request({
		url: `/admin/merchant/seckill/product/sku/up`,
		method: 'POST',
		data
	})
}

/** 秒杀商品sku下架 */
export function downSkuProSeckillApi(data) {
	return request({
		url: `/admin/merchant/seckill/product/sku/down`,
		method: 'POST',
		data
	})
}

/** 秒杀商品设置活动价 */
export function setSkuProSeckillApi(data) {
	return request({
		url: `/admin/merchant/seckill/product/set/price`,
		method: 'POST',
		data
	})
}